package com.jx.lcs.integral.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tianyu.jty.common.persistence.HibernateDao;
import com.tianyu.jty.common.service.BaseService;
import com.jx.lcs.integral.dao.IntegralActivityDao;
import com.jx.lcs.integral.entity.IntegralActivity;

/**
 * 积分活动service
 * @author JiaYy
 * @date 2015年8月27日
 */
@Service
@Transactional(readOnly=true)
public class IntegralActivityService extends BaseService<IntegralActivity, String> {
	
	@Autowired
	private IntegralActivityDao integralActivityDao;

	@Override
	public HibernateDao<IntegralActivity, String> getEntityDao() {
		return integralActivityDao;
	}
	
	/**
	 * 获取积分活动
	 * @return
	 */
	public IntegralActivity getIntegralActivity() {
		IntegralActivity model = null;
		List<IntegralActivity> list = integralActivityDao.findAll();
		if(list != null && list.size() > 0) {
			model = list.get(0);
		}
		return model;
	}
	
	
}
